function sort(arr)
{
  let num = count(arr)
  let temp = []
  for (let i = 0; i < num; i++) {
    for (let j = i + 1; j < num; j++) {
      if (arr[i]['distance'] > arr[j]['distance']) {

        temp = arr[i]
        arr[i] = arr[j]
        arr[j] = temp
      }
    }
  }
  return arr;
}
function count(arr)
{
  let n = 0
  for (let i in arr) {
    n++;
  }
  return n;
}
module.exports = {
  sort: sort,
}